IF OBJECT_ID('dbo.RptPopulateCachedTables') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.RptPopulateCachedTables
    IF OBJECT_ID('dbo.RptPopulateCachedTables') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.RptPopulateCachedTables >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.RptPopulateCachedTables >>>'
END
go
-- =======================================================================
-- Procedure Name: dbo.RptPopulateCachedTables
--
-- Author:      Kevin Cashman, Parallax Consulting LLC
--
-- Create date: 8/29/2007
--
-- Description: Populates two cached tables..
--             dbo.AgrAgreement_Budget
--             dbo.AgrAgreement_Info
--
-- Parameters:  
--              
--              
-- Returns:     INT, 0=Success, -1=Error
--
-- SampleCall:
-- EXECUTE dbo.RptPopulateCachedTables( )
--
--------------------------------------------------------------------------
-- Date        Initials  Modification
--------------------------------------------------------------------------
-- 8/29/07     KC        Created
-- 12/31/2007  KC        Changed order of call since Budgets now depend
--                       on Agreement table.
--
-- =======================================================================
CREATE PROCEDURE dbo.RptPopulateCachedTables
AS
BEGIN
     -- Initial Settings
     SET NOCOUNT ON

     -- Declare Local Variables
     DECLARE   @Error            INT,
               @RowCount         INT

     -- Call Procedure for Agreements
     EXECUTE dbo.RptPopulateAgreementInfoTable

     -- Call Procedure for Budgets
     EXECUTE dbo.RptPopulateAgreementBudgetTable
     
     -- Return Success
     RETURN 0
     
END
go

IF OBJECT_ID('dbo.RptPopulateCachedTables') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.RptPopulateCachedTables >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.RptPopulateCachedTables >>>'
go

GRANT EXECUTE ON dbo.RptPopulateCachedTables TO InsightReport,Insight
go